#include<iostream>
int main()
{
  int val=0,currval=0;
  if (std::cin>>currval){
    int cnt=1;
    while(std::cin>>val){
      if (val==currval)
	++cnt;
      else{
	std::cout<<currval<<"出现了"<<cnt<<"次"<<std::endl;
	currval=val;
	cnt=1;
      }
    }
    std::cout<<currval<<"出现了"<<cnt<<"次"<<std::endl;
  }
  return 0;
}
